export const listen = <K extends keyof WindowEventMap>(
	type: K,
	listener: (this: Window, ev: WindowEventMap[K]) => any,
	options?: boolean | AddEventListenerOptions
) => {
	addEventListener(
		type,
		(e) => {
			requestAnimationFrame(() => {
				listener.call(window, e)
			})
		},
		options
	)
}
